import request from '@/utils/request'

// 查询客户信息列表
export function listCustomers(query) {
  return request({
    url: '/customers/customers/list',
    method: 'get',
    params: query
  })
}

// 查询供应商信息列表(不分页)
export function findCustomer() {
  return request({
    url: '/customers/customers/selectAll',
    method: 'post'
  })
}

// 查询客户信息详细
export function getCustomers(id) {
  return request({
    url: '/customers/customers/' + id,
    method: 'get'
  })
}

// 新增客户信息
export function addCustomers(data) {
  return request({
    url: '/customers/customers',
    method: 'post',
    data: data
  })
}

// 修改客户信息
export function updateCustomers(data) {
  return request({
    url: '/customers/customers',
    method: 'put',
    data: data
  })
}

// 删除客户信息
export function delCustomers(ids) {
  return request({
    url: '/customers/customers/' + ids,
    method: 'delete'
  })
}

// 获取编码
export function getCode(code) {
  return request({
    url: '/customers/customers/getcode?code=' + code,
    method: 'post'
  })
}
// 查询详情
export function selectCustomers(id) {
  return request({
    url: '/customers/customers/selectCustomers?id='+id,
    method: 'get'
  })
}
